/**
 *
 */
package com.he.demo.yyt.zy;


import java.text.ParseException;
import java.util.Map;

/**
 * @author <a href="mailto:xuyy@yyt.com">Xu Yuanyuan</a>
 * @version 1.0
 * @date 2018年8月2日 上午9:07:32
 * @desc 住院病人基本信息
 */
public class InPatient {
	/** 病人ID */
	private String patient_id;
	/** 住院次数 */
	private String series;
	/** 住院号 */
	private String admission_id;
	/** 病人姓名 */
	private String patient_name;
	/** 证件类型 */
	private String idno_type;
	/** 证件号码 */
	private String idno;
	/** 婚姻状况 */
	private String marriage;
	/** 户籍：农村 城镇 */
	private String node_type;
	/** 性别 */
	private String sex;
	/** 科室号 */
	private String dept_code;
	/** 科室名称 */
	private String dept_name;
	/** 病区编号 */
	private String ward_code;
	/** 病区名称 */
	private String ward_name;
	/** 床位号 */
	private String bed_no;
	/** 出生日期 格式yyyy-MM-dd */
	private String date_birth;
	/** 年龄 */
	private String age;
	/** 联系电话 */
	private String phone;
	/** 现住址 */
	private String address;
	/** 家庭住址 */
	private String home_address;
	/** 职业 */
	private String job;
	/** 联系方式 */
	private String contact_info;
	/** 国籍 */
	private String country;
	/** 民族 */
	private String nation;
	/** 体重 */
	private String weight;
	/** 身高 */
	private String height;
	/** 入院时间 */
	private String admission_time;
	/** 入科时间 */
	private String admission_ward_time;
	/** 出院时间 */
	private String discharge_time;
	/** 入院诊断 */
	private String diagnosis;
	/** 护理级别 特级护理,一级护理,二级护理,三级护理 */
	private String nursing_class;
	/** 病人病情 一般，病危,病重 */
	private String patient_condition;
	/** 主治医生 */
	private String doctor;
	/** 病人状态 住院,出院 */
	private String inout_status;
	/** 联系人姓名 */
	private String contact_name;
	/** 联系人关系 */
	private String contact_rela;
	/** 联系人身份证号 */
	private String contact_idno;
	/** 联系人电话 */
	private String contact_phone;
	/** 联系人地址 */
	private String contact_address;
	/** 文化程度 */
	private String education;

    /** 分娩日期 */
    private  String fenmian_riqi;

    /** 分娩方式 */
    private  String fenmian_fangshi;

    /** 高危 */
    private  String gaowei;

    private Integer wm_id;

	private String risk_max_rank;

	/**
	 * 住院艾乙梅信息，从住院表单中查询
	 */
	private Map<String,Object> cfAymMap;
	/**
	 * 门诊艾乙梅信息，从lis 或门诊表单忠诚
	 */
	private Map<String,Object> mzAymMap;

	public Map<String, Object> getCfAymMap() {
		return cfAymMap;
	}

	public void setCfAymMap(Map<String, Object> cfAymMap) {
		this.cfAymMap = cfAymMap;
	}

	public Map<String, Object> getMzAymMap() {
		return mzAymMap;
	}

	public void setMzAymMap(Map<String, Object> mzAymMap) {
		this.mzAymMap = mzAymMap;
	}


	public String getRisk_max_rank() {
		return risk_max_rank;
	}

	public void setRisk_max_rank(String risk_max_rank) {
		this.risk_max_rank = risk_max_rank;
	}

	public String getPatient_id() {
		return patient_id;
	}

	public void setPatient_id(String patient_id) {
		this.patient_id = patient_id;
	}

	public String getSeries() {
		return series;
	}

	public void setSeries(String series) {
		this.series = series;
	}

	public String getAdmission_id() {
		return admission_id;
	}

	public void setAdmission_id(String admission_id) {
		this.admission_id = admission_id;
	}

	public String getPatient_name() {
		return patient_name;
	}

	public void setPatient_name(String patient_name) {
		this.patient_name = patient_name;
	}

	public String getIdno_type() {
		return idno_type;
	}

	public void setIdno_type(String idno_type) {
		this.idno_type = idno_type;
	}

	public String getIdno() {
		return idno;
	}

	public void setIdno(String idno) {
		this.idno = idno;
	}

	public String getMarriage() {
		return marriage;
	}

	public void setMarriage(String marriage) {
		this.marriage = marriage;
	}

	public String getNode_type() {
		return node_type;
	}

	public void setNode_type(String node_type) {
		this.node_type = node_type;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getDept_code() {
		return dept_code;
	}

	public void setDept_code(String dept_code) {
		this.dept_code = dept_code;
	}

	public String getDept_name() {
		return dept_name;
	}

	public void setDept_name(String dept_name) {
		this.dept_name = dept_name;
	}

	public String getWard_code() {
		return ward_code;
	}

	public void setWard_code(String ward_code) {
		this.ward_code = ward_code;
	}

	public String getWard_name() {
		return ward_name;
	}

	public void setWard_name(String ward_name) {
		this.ward_name = ward_name;
	}

	public String getBed_no() {
		return bed_no;
	}

	public void setBed_no(String bed_no) {
		this.bed_no = bed_no;
	}

	public String getDate_birth() {
		return date_birth;
	}

	public void setDate_birth(String date_birth) {
		this.date_birth = date_birth;
	}

	public String getAge() {
		if(age!=null){
			age=age.replaceAll("[0-9]+月","");
			if(age.contains("岁")){
                age = age.split("岁")[0];
            }
		}
		return age;
	}

	public void setAge(String age) {
		this.age = age;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getHome_address() {
		return home_address;
	}

	public void setHome_address(String home_address) {
		this.home_address = home_address;
	}

	public String getJob() {
		return job;
	}

	public void setJob(String job) {
		this.job = job;
	}

	public String getContact_info() {
		return contact_info;
	}

	public void setContact_info(String contact_info) {
		this.contact_info = contact_info;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getNation() {
		return nation;
	}

	public void setNation(String nation) {
		this.nation = nation;
	}

	public String getWeight() {
		return weight;
	}

	public void setWeight(String weight) {
		this.weight = weight;
	}

	public String getHeight() {
		return height;
	}

	public void setHeight(String height) {
		this.height = height;
	}

	public String getAdmission_time() {
		return admission_time;
	}

	public void setAdmission_time(String admission_time) {
		this.admission_time = admission_time;
	}

	public String getAdmission_ward_time() {
		return admission_ward_time;
	}

	public void setAdmission_ward_time(String admission_ward_time) {
		this.admission_ward_time = admission_ward_time;
	}

	public String getDischarge_time() {
		return discharge_time;
	}

	public void setDischarge_time(String discharge_time) {
		this.discharge_time = discharge_time;
	}

	public String getDiagnosis() {
		return diagnosis;
	}

	public void setDiagnosis(String diagnosis) {
		this.diagnosis = diagnosis;
	}

	public String getNursing_class() {
		return nursing_class;
	}

	public void setNursing_class(String nursing_class) {
		this.nursing_class = nursing_class;
	}

	public String getPatient_condition() {
		return patient_condition;
	}

	public void setPatient_condition(String patient_condition) {
		this.patient_condition = patient_condition;
	}

	public String getDoctor() {
		return doctor;
	}

	public void setDoctor(String doctor) {
		this.doctor = doctor;
	}

	public String getInout_status() {
		return inout_status;
	}

	public void setInout_status(String inout_status) {
		this.inout_status = inout_status;
	}

	public String getContact_name() {
		return contact_name;
	}

	public void setContact_name(String contact_name) {
		this.contact_name = contact_name;
	}

	public String getContact_rela() {
		return contact_rela;
	}

	public void setContact_rela(String contact_rela) {
		this.contact_rela = contact_rela;
	}

	public String getContact_idno() {
		return contact_idno;
	}

	public void setContact_idno(String contact_idno) {
		this.contact_idno = contact_idno;
	}

	public String getContact_phone() {
		return contact_phone;
	}

	public void setContact_phone(String contact_phone) {
		this.contact_phone = contact_phone;
	}

	public String getContact_address() {
		return contact_address;
	}

	public void setContact_address(String contact_address) {
		this.contact_address = contact_address;
	}

	public String getEducation() {
		return education;
	}

	public void setEducation(String education) {
		this.education = education;
	}

    public String getFenmian_riqi() {
        return fenmian_riqi;
    }

    public void setFenmian_riqi(String fenmian_riqi) {
        this.fenmian_riqi = fenmian_riqi;
    }

    public String getFenmian_fangshi() {
        return fenmian_fangshi;
    }

    public void setFenmian_fangshi(String fenmian_fangshi) {
        this.fenmian_fangshi = fenmian_fangshi;
    }

    public String getGaowei() {
        return gaowei;
    }

    public void setGaowei(String gaowei) {
        this.gaowei = gaowei;
    }

    public Integer getWm_id() {
        return wm_id;
    }

    public void setWm_id(Integer wm_id) {
        this.wm_id = wm_id;
    }

    public boolean isShoushu() {
        return "剖宫产".equals(fenmian_fangshi);
    }

    public Integer getTianshu() throws ParseException {
        if (fenmian_riqi!=null) {
            return null;
        }

        return 0;// DateUtil.daysBetween(DateUtil.formatString(fenmian_riqi, DateUtil.YYYY_MM_DD), DateUtil.currentDate());
    }

    public boolean isTimeout() throws ParseException {
	    Integer days = getTianshu();
        if (days == null) {
            return false;
        }

        return isShoushu() ? days > 7 : days > 3;
    }

    public boolean isRisk(){return gaowei!=null&&!"".equals(gaowei);}
}

